原本要分享換頁的動畫,
不過套用下來有出現問題,
今天狀況也不大好沒精神研究了...
如果過兩天有精神試成功了再分享吧...
作為最後的完結篇就分享一下改變API版本的方法,
有時候我們要使用某些功能,
結果Android跟我們說我們程式的API的最低版本不支援這個功能,
至少要多少版本以上才可以支援,
那到底要怎麼改API的版本呢?
小弟所知有兩種方式,
今天分享第一種,
在Gradle Scripts底下找到build.gradle標籤點擊下去
就會看到以下內容
apply plugin: 'com.android.application'
android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.user.bmi"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
其中今天要講到的三行就是
compileSdkVersion 28
minSdkVersion 15
targetSdkVersion 28
其中compileSdkVersion和targetSdkVersion是最高版本,而minSdkVersion是最低版本,根據需要調整即可
改完之後右上角會出現Sync Now請你馬上更新版本,點下去就好了
恭喜大大完賽!
謝謝,
其實已經31天了,
因為我的第一天是 Day00.
哇哇,
大大每年都有參加啊,
真是歷史悠久...